
{{ $page := .page }}

{{ $tokens := partial "tokensFromPagePath" $page.Path }}
{{ $name := partial "nameFromPagePath" $page.Path }}
{{ $tag := partial "tagFromPagePath" $page.Path }}

{{ $depth := len $tokens }}

{{ $title := $page.Param "title" }}
{{ if (not (eq nil ($page.Param "menuTitle"))) }}
  {{ $title = ($page.Param "menuTitle") }}
{{ end }}

<a href="/#{{ $tag }}" class="menu-item depth-{{ $depth }}">
    {{ $page.Param "menuIcon" }}
    {{ if (eq $depth 1) }}
    <strong>
    {{ end }}
        {{ $title | markdownify }}
    {{ if (eq $depth 1) }}
    </strong>
    {{ end }}
</a>


{{ if (not ($page.Param "suppressMenu")) }}
<ul class="menu-item-section depth-{{ $depth }}">
{{ range ($page.Param "entries") }}
    <li>
    {{ with $page.GetPage . }}
      {{ partial "menuLayoutPartial.html" (dict "page" . "depth" (add $depth 1)) }}
    {{ end }}
    </li>
{{ end }}
</ul>
{{ end }}
